package pattern8;

/**
 * 外观类
 * <p>
 * 了解子系统的方法和属性，进行组合方便外部调用
 *
 * @author wdl
 */
public class Facade {
    private SubSystemOne subSystemOne;
    private SubSystemTwo subSystemTwo;
    private SubSystemThree subSystemThree;

    public Facade() {
        subSystemOne = new SubSystemOne();
        subSystemTwo = new SubSystemTwo();
        subSystemThree = new SubSystemThree();
    }

    public void methodA() {
        System.out.println("\n方法组合A");
        subSystemOne.methodOne();
        subSystemTwo.methodTwo();
        subSystemThree.methodThree();
    }

    public void methodB() {
        System.out.println("\n方法组合B");
        subSystemThree.methodThree();
        subSystemTwo.methodTwo();
    }
}
